package com.stfalcon.chatkit.sample.features.main;

import android.content.Intent;
import android.content.SharedPreferences;
import android.os.Bundle;

import androidx.appcompat.app.AppCompatActivity;

import com.stfalcon.chatkit.sample.R;
import com.stfalcon.chatkit.sample.features.demo.LoginActivity;
import com.stfalcon.chatkit.sample.features.main.adapter.DemoCardFragment;
import com.stfalcon.chatkit.sample.utils.SharedPreferencesAtrribute;

/*
 * Created by troy379 on 04.04.17.
 */
public class MainActivity extends AppCompatActivity
        implements DemoCardFragment.OnActionListener {

   private SharedPreferences sharedPreferences;


    @Override
    protected void onStart() {
        sharedPreferences = this.getSharedPreferences(SharedPreferencesAtrribute.SAVE_FILE_NAME, SharedPreferencesAtrribute.FILE_MODE);

        SharedPreferencesAtrribute.setSharedPreferences(sharedPreferences);
        super.onStart();

    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);



        Intent intent = new Intent(this, LoginActivity.class);

        this.startActivity(intent);

//        ViewPager pager = findViewById(R.id.pager);
//        pager.setAdapter(new MainActivityPagerAdapter(this, getSupportFragmentManager()));
//        pager.setPageMargin((int) getResources().getDimension(R.dimen.card_padding) / 4);
//        pager.setOffscreenPageLimit(3);
//
//        CircleIndicator indicator = findViewById(R.id.indicator);
//        indicator.setViewPager(pager);

    }

    @Override
    public void onAction(int id) {




//
//        switch (id) {
//            case MainActivityPagerAdapter.ID_DEFAULT:
//                LoginActivity.open(this);
//                break;
//            case MainActivityPagerAdapter.ID_STYLED:
//                StyledDialogsActivity.open(this);
//                break;
//            case MainActivityPagerAdapter.ID_CUSTOM_LAYOUT:
//                CustomLayoutDialogsActivity.open(this);
//                break;
//            case MainActivityPagerAdapter.ID_CUSTOM_VIEW_HOLDER:
//                CustomHolderDialogsActivity.open(this);
//                break;
//            case MainActivityPagerAdapter.ID_CUSTOM_CONTENT:
//                CustomMediaMessagesActivity.open(this);
//                break;
//        }
    }
}
